//
//  SourceEditorCommand.swift
//  xcodesort-es
//
//  Created by 赵梁 on 2021/5/26.
//

import Foundation
import XcodeKit

class SourceEditorCommand: NSObject, XCSourceEditorCommand {
    
    func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void ) -> Void {
        // Implement your command here, invoking the completion handler when done. Pass it nil on success, and an NSError on failure.
        if let navigator = MenuManager.find(commandIdentifier: invocation.commandIdentifier) {
          DispatchQueue.main.async {
            navigator.navigate(invocation: invocation)
            completionHandler(nil)
          }
        }
    }
    
}
